var quark_posts_get_api = "http://192.168.1.225:8081/posts";
var w = new Vue({
    el:"#wrapper",
    data:{
        //表示显示的图标
        static: "",
        list:[],
        isTotal:false,
        totalNumber:20
    },
    mounted:function () {
        this.$nextTick(function () {
            this.createView();
        })
    },
    filters:{  //过滤器

    },
    methods:{
        createView:function () {
            var type = null;
            var search =null;
            var _this = this;
            $.get(quark_posts_get_api, {
                type: type,
                search: search,
                pageNo: 1,
                length: _this.totalNumber,
            }, function (data) {
                _this.list = data.data;
                if(data.total === 0){
                    _this.isTotal = true;
                }
            });
        },
        toJson:function (string) {
            if(!string) return false;
            return JSON.parse(string);
        },
        jsonLen:function (string) {
            if(!string) return 0;
            var i = 0;
            for (var j in JSON.parse(string)){
                i++;
            }
            return i;
        }
    },

});